package com.situ.mall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.situ.mall.common.ServerResponse;
import com.situ.mall.dao.CategoryMapper;
import com.situ.mall.entity.Category;
import com.situ.mall.entity.CategoryCount;
import com.situ.mall.service.ICategoryService;

@Service
public class CategoryServiceImpl implements ICategoryService{
	@Autowired
	private CategoryMapper categoryMapper;

	@Override
	public ServerResponse selectTopCategory() {
		List<Category> list =categoryMapper.selectTopCategory();
		return ServerResponse.createSuccess("查找成功", list);
	}

	@Override
	public ServerResponse selectSecondCategory(Integer topCategoryId) {
		List<Category> list =categoryMapper.selectSecondCategory(topCategoryId);
		return ServerResponse.createSuccess("查找成功", list);
	}

	@Override
	public List<Category> selectTopCategoryList() {
		List<Category> list =categoryMapper.selectTopCategory();;
		return list;
	}

	@Override
	public List<Category> selectSecondCategoryList() {
		List<Category> list = categoryMapper.selectSecondCategoryList();;
		return list;
	}

	@Override
	public ServerResponse getCategoryCount() {
		List<CategoryCount> list = categoryMapper.getCategoryCount();
		return ServerResponse.createSuccess("查询成功", list);
	}

}
